<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 有字符串:"aaeeecdddf"利用代码统计每一个字符出现的次数结果:{"a":2,"e":3,"c":1,"d":3,"f":1} -->
    <script>
        let str = 'aaeeecdddf'
        let b = str.split('');
        let c = {};
        for (let i = 0; i < b.length; i++) {
            if (c.hasOwnProperty(b[i])) {
                c[b[i]]++
            } else {
                c[b[i]] = 1
            }
        };

        console.log(c)
    </script>
</body>

</html>